package com.zhan.service;

import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;

@RestController
@RequestMapping("A")
public class ServiceA {
	
	@Autowired
	private RestTemplate restTemplate;
	
	
	@RequestMapping("/{id}")
	public String echo(@PathVariable String id) {
		
		
		
		System.out.println(id);
		String result = restTemplate.getForObject("http://localhost:8088/B/"+id, String.class);
		return "A hello world " + result;
	}
	
}
